package com.docker.core.third.websocket;

import com.docker.core.mvc.Remark;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author ldl
 * @Create 2020/08/16 016 16:05
 */
@Remark("websocket命令码")
public class WebsocketCMD {

    public static final List<String> SECOND_CMDS = new ArrayList<>();//全部密令码
    /**
     * 一级命令码
     */
    public static final List<String> CMDS = new ArrayList<>();

    //一级命令码，用于主服务与第三方[客户端]通讯
    public static final String ON_OPEN = "on_open";//连接打开
    public static final String ON_CLOSE = "on_close";//连接关闭
    public static final String ON_ERROR = "on_error";//发生错误
    public static final String ON_MESSAGE = "on_message";//推送消息

    //二级命令码，用于第三方[客户端]与主服务通讯
    public static final String CMD_IMAGE_PULL = "image_pull";//镜像拉取
    /**
     * 服务器指令
     */
    public static final String SERVER_CMD = "server_cmd";

    //二级命令码需要在这里注册
    static {
        CMDS.add(ON_MESSAGE);
        CMDS.add(ON_OPEN);
        CMDS.add(ON_CLOSE);
        CMDS.add(ON_ERROR);
        SECOND_CMDS.add(CMD_IMAGE_PULL);
        SECOND_CMDS.add(SERVER_CMD);
    }

}
